<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<link rel="stylesheet" type="text/css" href="/css/formSelects-v4.css"/>
<head th:include="layout :: htmlhead" th:with="title='类别管理'"></head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!--头-->
    <div th:replace="fragments/head :: header"></div>

    <div class="layui-body" style="margin: 1%">
        <table id="category1List" lay-filter="category1Table"></table>

        <button class="layui-btn layui-btn-normal" onclick="add()">新增</button>

        <script type="text/html" id="optBar">
            <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
            {{#  if(d.status == '1'){ }}
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="recover">恢复</a>
            {{#  } else { }}
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
            {{#  } }}
        </script>
    </div>

    <!--添加或编辑-->
    <div id="setCategory1" class="layer_self_wrap" style="width:500px;display:none;">
        <form id="category1Form" class="layui-form layui-form-pane" method="post" action="" style="margin-top: 20px;">
            <input id="pageNum" type="hidden" name="pageNum"/>
            <input id="category1Id" type="hidden" name="category1Id"/>

            <div class="layui-form-item">
                <label class="layui-form-label">类别名称</label>
                <div class="layui-input-inline">
                    <input id="category1Name" name="category1Name" lay-verify="required" autocomplete="off" class="layui-input" type="text"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">类别描述</label>
                <div class="layui-input-inline">
                    <input id="category1Remark" name="category1Remark" lay-verify="required" autocomplete="off" class="layui-input" type="text"/>
                </div>
            </div>
            <div class="layui-form-item">


                <div class="layui-input-inline uploadHeadImage">
                    <div class="layui-upload-drag" id="uploadImg">
                        <i class="layui-icon" style="width:150px;"></i>
                        <p>点击上传图片，或将图片拖拽到此处</p>
                    </div>
                </div>
                <div class="layui-input-inline">
                    <div class="layui-upload-list">
                        <img class="layui-upload-img headImage" src="http://t.cn/RCzsdCq" style="width:150px;" id="demo1">
                        <p id="demoText"></p>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="margin-left: 10px;">
                <button id="submit0" type="button" class="layui-btn">上传</button>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="width: 250px;">图片地址(上传图片自动获取)</label>
            <div class="layui-input-inline">
                <input  id="category1Picture" name="category1Picture" readonly="readonly" value="" lay-verify="required" autocomplete="off" class="layui-input" type="text"/>
            </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="margin-left: 10px;">
                    <button class="layui-btn"  lay-submit="" lay-filter="category1Submit" id="submit" >提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>

    <!--底部-->
    <div th:replace="fragments/footer :: footer"></div>
    <script src="/js/category1/category1Manage.js"></script>

</div>
</body>
</html>